package com.bindapp.model;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.view.LayoutInflater;
import android.widget.CompoundButton;

import com.bindapp.R;
import com.bindapp.databinding.ActivityPaopaoBinding;


/**
 * Created by apple on 2018/7/1.
 */

public class PaopaoModel extends BaseModel {
    private ActivityPaopaoBinding binding;
    public PaopaoModel(Context context){
        super(context);
        binding= DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.activity_paopao,null,false);
        binding.switch2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                binding.statustxt.setText(b?"脉冲":"正常");
                binding.status.setText(b?"(每30秒停5秒)":"");
            }
        });
    }
    @Override
    public ViewDataBinding getBinding() {
        return binding;
    }
}
